package com.example.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.RecyclerView;

import com.example.adapter.MainRvAdapter;
import com.example.studyapplication.R;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Author: 葛浩杰
 * @CreateDate: 2021/6/23 11:54
 */
public class CoordinatorLayoutActivity extends Activity {

    private RecyclerView rv;

    public static void startActivity(Context context){
        Intent intent = new Intent(context,CoordinatorLayoutActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_coordinator);

        rv = findViewById(R.id.recyclerView);
        rv.setLayoutManager(new LinearLayoutManager(this));

        List<String> data = new ArrayList<>();
        for (int i=0;i<30;i++){
            data.add("社会主义" + i);
        }

        rv.setAdapter(new MainRvAdapter(this, data));

    }
}
